package org.beetl.sql.core.db;

import org.beetl.sql.clazz.kit.SpecialKeyWordHandler;
import org.beetl.sql.core.range.OffsetLimitRange;
import org.beetl.sql.core.range.RangeSql;

/**
 * 数据库差异：h2.
 *
 * @author zhoupan
 */
public class Gbase8sStyle extends AbstractDBStyle {

    RangeSql rangeSql = null;
    public Gbase8sStyle() {
        super();
        this.keyWordHandler = new SpecialKeyWordHandler();
        rangeSql = new OffsetLimitRange(this);
    }

    public String getPageSQL(String sql) {
        return sql + this.getOrderBy() + " \nlimit " + sqlTemplateEngine.appendVar(DBAutoGeneratedSql.OFFSET)+ " , " + sqlTemplateEngine.appendVar(DBAutoGeneratedSql.PAGE_SIZE);
    }


    @Override
    public String getName() {
        return "gbase8s";
    }

    @Override
    public int getDBType() {
        return DBType.DB_GBASE8S;
    }

    @Override
    public RangeSql getRangeSql() {
        return rangeSql;
    }



}
